package cn.leftsite.java11;

import java.io.FileOutputStream;
import java.io.IOException;

public class InputStreamDemo {
    public static void main(String[] args) throws IOException {
        var cl = InputStreamDemo.class.getClassLoader();

        try (var in = cl.getResourceAsStream("file"); var out = new FileOutputStream("out")) {
            in.transferTo(out);
        }
    }
}
